#pragma once

#include <map>
#include <string>
#include <d3d11.h>

class TextureMgr
{
public:
	TextureMgr();
	~TextureMgr();

	static TextureMgr* Instance()
	{		
		if (!ins)
		{
			ins = new TextureMgr();
		}
		return ins;
	}

	ID3D11ShaderResourceView* CreateTexture(ID3D11Device* device, const std::wstring& filename);
	std::map<std::wstring, ID3D11Texture2D *> mTextures;
	std::map < std::wstring, ID3D11ShaderResourceView*> mSRVs;

	class Garbage
	{
	public:
		Garbage(){}
		~Garbage()
		{
			if (TextureMgr::ins != NULL)
			{
				delete ins;
				ins = NULL;
			}
		}

	private:

	};
private:
	static TextureMgr* ins;
	static Garbage  garbage;
};

